package com.sishu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sishu.pojo.Gus;
import com.sishu.pojo.Role;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;


public interface GusMapper extends BaseMapper<Gus> {


    @Select("select  * from gus where s_id = #{sId} and group_id = #{groupId}")
    Gus selectroleId(String sId, String groupId);

    @Update("update gus set upgrade_times = #{upgradeTime} where s_id = #{sId} and group_id = #{groupId}")
    void setupgradetimes(int upgradeTime, String sId, String groupId);

    @Update("update gus set role_id = #{roleId} where s_id = #{sId} and group_id = #{groupId}")
    void setroleId(int roleId, String sId, String groupId);


    @Select("select  * from gus where team = #{team} and group_id = #{groupId}")
    List<Gus> selectteam(String team, String groupId);

    @Select("select revivefirstused from gus where s_id = #{sId} and group_id = #{groupId}")
    Integer selectrevivefirstused(String sId, String groupId);

    @Update("update gus set revivefirstused = 1 where s_id = #{sId} and group_id = #{groupId}")
    void revivefirstusedone(String sId, String groupId);

    @Update("update gus set isdelete = 1 where s_id = #{PartyA} and group_id = #{groupId}")
    void setisdeleteone(String PartyA, String groupId);

    @Select("select isdelete from gus where s_id = #{PartyA} and group_id = #{groupId}")
    Integer selectisdelete(String PartyA, String groupId);

    @Update("update gus set role_id = #{roleId} where s_id = #{sId} and group_id = #{groupId}")
    Integer updategus(String sId, String groupId, int roleId);


    @Select("select * from gus where role_id = #{roleId} and group_id = #{groupId} and s_id = #{sId}")
    Role selectrole(String sId, String groupId, int roleId);
}
